<?php
/**
 * Created by PhpStorm.
 * User: penggao
 * Date: 2018/7/26
 * Time: 下午10:17
 */
use PHPMailer\PHPMailer;
require_once '../inc/sendEmail.class.php';
require_once '../conn/conn.class.php';
$tb_Name = trim($_GET['usrName']);
$tb_Psw = md5($_GET['psw']);
$tb_Email = trim($_GET['email']);
$tb_RealName = trim($_GET['realName']);
$tb_Telphone = $_GET['tel'];
$tb_Quetion = trim($_GET['question']);
$tb_Answr = trim($_GET['answer']);
$tb_Birth = $_GET['birth'];
$Dbdate= new conn('127.0.0.1','root','root','phplogin');
$nUrl='http://'.$_SERVER['SERVER_NAME'].'/phpCode/actuion/active.php';
$nUrl.='?name='.$tb_Name.'&psw='.$tb_Psw;
$sql = "insert into tb_register(user,password,realname,question,answer,telphone,birthday,email) values ('".$tb_Name."','".$tb_Psw."','".$tb_RealName."','".$tb_Quetion."','".$tb_Answr."','".$tb_Telphone."','".$tb_Birth."','".$tb_Email."')";
//echo $Dbdate->aduRst($sql);
if($Dbdate->aduRst($sql)!= false){
	$emailS=new sendEmail();
	if($emailS->sendMail($tb_Email,'Facebook激活邮件',$nUrl)=='1'){
		echo "1";
	}else{
		echo $emailS->mail->ErrorInfo;
	}
}else{
	echo "-1";
}
$Dbdate->close_mysql();
